<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\NewsRepo;
class NewsController extends ApiBaseController
{
    public function detail(Request $request,int $id)
    {
        if(!$id) {
            return $this->errRes('缺少参数ID');
        }
        $repo = new NewsRepo();
        $data['new_info'] = $repo->getNewsInfo($id);
        return $this->sucRes(200,$data);
    }
    public function lists(Request $request)
    {
        $repo = new NewsRepo();
        $data['news_lists'] = $repo->getNewsList();
        return $this->sucRes(200,$data);
    }
}